from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    # XPATH定位方法
    def sou(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜商品名称 作者 出版社 ISBN"]')
        ele=self.find_ele(loc)
        return ele
    # CLASS_NAME定位方法
    def sou2(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    # ID定位方法
    def sou3(self):
        loc = (By.ID, 'com.kongfz.app:id/tvSearch')
        ele = self.find_ele(loc)
        return ele
    # ANDROID_UIAUTOMATOR定位方法
    def dianji(self):
        loc = (By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.kongfz.app:id/ivPic").instance(6)')
        ele = self.find_ele(loc)
        return ele
    def gwc(self):
        loc = (By.ID, 'com.kongfz.app:id/tvAddCart1')
        ele = self.find_ele(loc)
        return ele
    def duan(self):
        loc=(By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tvName" and @text="筛选"]')
        ele=self.find_ele(loc)
        return ele
    def duan2(self):
        loc=(By.ID,'com.kongfz.app:id/fl2')
        ele=self.find_ele(loc)
        return ele
















